<?php
// echo 111;
$uid = $_GET['uid'];
$link = mysqli_connect("localhost","root","root","2113");


$sql = "SELECT p.pname,c.num,p.img,p.id,p.price FROM cart AS c JOIN product AS p ON  c.pid=p.id WHERE c.uid=$uid";
// echo $sql;die;
$res =  mysqli_query($link,$sql);


$arr = [];
while($one=  mysqli_fetch_assoc($res)){
	$arr[] = $one;
}

// print_r($arr);
echo json_encode($arr);
?>